Rotations and Scaling
Introduction
In this article, we explore two of the most visually intuitive linear transformations in the plane:
- Rotations — spinning objects around the origin
- Scaling — stretching or shrinking objects
You already know what a linear transformation is. Now we look at how specific matrices act on 2D space and how to interpret their geometric meaning.
What Are Rotations?
A rotation turns every point in the plane around the origin by some angle $\theta$.
The standard rotation matrix is: $$R_\theta = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}$$ Key properties:
- Rotations preserve lengths.
- Rotations preserve angles.
- Rotations do not change the shape of objects — only their orientation.
Useful facts:
- A $90^\circ$ rotation uses $\theta = \frac{\pi}{2}$.
- A $180^\circ$ rotation uses $\theta = \pi$.
- A $0^\circ$ rotation is just the identity matrix.
What Is Scaling?
Scaling stretches or shrinks objects.
A simple scaling matrix: $$S = \begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix}$$ Effects:
- If $a > 1$, the $x$‑direction is stretched.
- If $0 < a < 1$, the $x$‑direction is compressed.
- If $a < 0$, the $x$‑direction is flipped and scaled.
Same for $b$ in the $y$‑direction.
Special case: uniform scaling $$kI = \begin{pmatrix} k & 0 \\ 0 & k \end{pmatrix}$$ This stretches or shrinks equally in all directions.
Combining Rotations and Scaling
Because matrices represent linear transformations, we can compose them:
- First scale, then rotate: $R_\theta S$
- First rotate, then scale: $S R_\theta$
These are usually not the same matrix — order matters.

Geometric Interpretation
To understand a matrix, look at what it does to:
- The basis vectors $e_1 = (1,0)$ and $e_2 = (0,1)$
- A simple shape (square, triangle, grid)
- Distances and angles
Rotations:
- Preserve shape
- Preserve area
- Move points along circular arcs
Scaling:
- Changes size
- May distort shapes
- Multiplies area by $ab$ for matrix $\begin{pmatrix}a&0\\0&b\end{pmatrix}$
Examples
1. Rotation by $90^\circ$
$$R_{\pi/2} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$$ Effect: turns every point counterclockwise by $90^\circ$.
2. Scaling by 2 in $x$ and 1/2 in $y$
$$S = \begin{pmatrix} 2 & 0 \\ 0 & 1/2 \end{pmatrix}$$ Effect: stretches horizontally, compresses vertically.
3. Uniform scaling by 3
$$3I = \begin{pmatrix} 3 & 0 \\ 0 & 3 \end{pmatrix}$$ Effect: enlarges all shapes by a factor of 3.
Calculator
Creating rotation matrices
- Rotation matrices can be craated using the $\operatorname{rotationMatrix}()$ function:
rotationMatrix(pi/2) rotationMatrix(90deg)
Creating scaling matrices
- Scaling matrices are easy to create, so no helper functions exist for them
[a, 0; 0, b]
Exercises
(5–10 exercises, each with an import‑comment as required)
Exercises
- Compute $R_{\pi/2}(1,2)$ using $R_{\pi/2} = \begin{pmatrix}0 & -1 \\ 1 & 0\end{pmatrix}$.
- Describe the geometric effect of $S = \begin{pmatrix}3 & 0 \\ 0 & 1\end{pmatrix}$.
- Determine whether the transformation $T(x,y) = (2x,\, -3y)$ is a scaling transformation.
- Compute the result of applying a uniform scaling by $k=4$ to the vector $(1,-2)$.
- Compute $R_\theta(1,0)$ for $\theta = \frac{\pi}{3}$.
- True or false: A rotation can change the length of a vector.
- Compute the composition $R_{\pi/2} S$ where $S = \begin{pmatrix}2 & 0 \\ 0 & 2\end{pmatrix}$.